package com.example.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//@Component
public class userConfig2 implements InitializingBean {

    @Autowired(required = false)
    private User user;

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println(user.getName() + user.getAge());
    }
}
